package cn.kk.fluidcells.cells.mouse;

import java.util.LinkedList;
import java.util.List;
import java.util.Locale;

import cn.kk.fluidcells.api.CellFeature;
import cn.kk.fluidcells.api.CellIdentifier;
import cn.kk.fluidcells.api.CellPlugin;
import cn.kk.fluidcells.cells.mouse.internal.MouseHook;

public class MouseCellPlugin implements CellPlugin {
    private final static String CELL_ID = "mouse";
    private final static String FEATURE_CLICK = "click";
    private final static String FEATURE_MOVE = "move";
    private final static String FEATURE_WHEEL = "wheel";
    private final MouseHook hook;

    public MouseCellPlugin() {
        this.hook = new MouseHook();
    }

    @Override
    public CellIdentifier getIdentifier() {
        return new CellIdentifier(MouseCellPlugin.CELL_ID);
    }

    @Override
    public List<CellIdentifier> getDependencies() {
        return CellPlugin.NO_DEPENDENCIES;
    }

    @Override
    public List<CellFeature> getFeatures(Locale appLocale) {
        List<CellFeature> features = new LinkedList<CellFeature>();
        features.add(new CellFeature(MouseCellPlugin.FEATURE_CLICK, "鼠标按键"));
        features.add(new CellFeature(MouseCellPlugin.FEATURE_MOVE, "鼠标移动"));
        features.add(new CellFeature(MouseCellPlugin.FEATURE_WHEEL, "鼠标滑轮"));
        return features;
    }

    @Override
    public void init() {
        this.hook.init();
    }

    @Override
    public void start() {
        this.hook.start();
    }

    @Override
    public void stop() {
        this.hook.stop();
    }

}
